home *** CD-ROM | disk | FTP | other *** search
- Path: zilker.net!usenet
- From: Jeff PErry <jeff@jsp.com>
- Newsgroups: comp.lang.c++
- Subject: C++ Wizard Question
- Date: Tue, 23 Jan 1996 13:15:09 -0600
- Organization: Zilker Internet Park, Inc.
- Message-ID: <310533BD.847@jsp.com>
- NNTP-Posting-Host: jsp.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0b4 (WinNT; I)
-
- So, you think you're a C++ Wizard, eh? Good. Then could you
- please comment on the following few statements:
-
- throw "This is an exception thrown deep in the call stack";
-
- ...
-
- catch (const char *E)
- {
- // Do something with E
- }
-
- This is a practice that I have used before, and only recently
- did it occur to me that it might not be such a great idea to be
- throwing a pointer to something on the stack. On the other
- hand, it is a constant, so it has to live somewhere permanently.
-
- The question is: Is it safe to assume that the string to which E
- points will be valid in my catch block, even though the call
- stack has been unwound?
-
- Thanks in advance,
- JEFF
-